# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=amdgpu-fan
pkgver=0.1.0
pkgrel=4
pkgdesc="Fan controller for AMD graphics cards running the amdgpu driver on Linux"
url="https://github.com/zzkW35/amdgpu-fan"
arch="noarch"
license="GPL-2.0-or-later"
depends="python3 py3-yaml py3-numpy"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/zzkW35/amdgpu-fan/archive/refs/tags/$pkgver.tar.gz"

prepare() {
	default_prepare

	sed -i "s/PROJECTVERSION/$pkgver/g" setup.py
}

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD/build/lib" pytest
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
b21d8e413d44a263fdbef37fff11a496fe5e46a1f4d1e7ade161dde36750cf0dc02dfd2ccaebc455dac5aa023150101a65a255a38e6d9b70a6bba39da8f26378  amdgpu-fan-0.1.0.tar.gz
"
